package com.amit.servlet;

import java.io.IOException;
import java.util.Locale;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LogoutServlet extends HttpServlet {
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		request.setAttribute("LOGOUT_SUCCESS", "ok");
		
		request.getRequestDispatcher("index.jsp").forward(request, response);
		String lan=request.getSession().getAttribute("LANGUAGE").toString();
		Locale loc=new Locale(lan);
		response.setLocale(loc);
		request.getSession().invalidate();
	}

}
